import { AudioClip } from "../resource/audio_clip";
import { Material } from "../resource/material";



class ResourceManager {


    loadRes() {

    }

    loadMaterial(name: String): Material {
        let material = Deno.core.ops.opLoadMaterial(name);

        return material;
    }

    loadTexture(name: String) {


    }

    loadMesh(name: String) {
        let mesh = Deno.core.ops.opLoadMesh(name);

        return mesh;
    }

    loadJson(name: string) {
        let text = Deno.core.ops.opLoadJson(name);
        if (text) {
            let json = JSON.parse(text);
            return json;
        }

    }

    loadAudio(name: string): AudioClip {
        return Deno.core.ops.opLoadAudio(name);
    }
}

export const resource = new ResourceManager();